package com.tuo51.core.repositories;

import com.tuo51.core.domain.org.Organization;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

public interface OrgnizationRepository extends JpaRepository<Organization, String>, JpaSpecificationExecutor<Organization> {

    Organization getByCreatorIdAndBizOrgIsFalse(String staffId);

    Page<Organization> findAllByNameLikeAndContactNumberIsNotNullAndBizOrgIsTrueOrderByCreatedDesc(String name, Pageable pageRequest);

    Page<Organization> findAllByContactNumberIsNotNullAndBizOrgIsTrueOrderByCreatedDesc(Pageable pageRequest);

}
